import './lib/utils/css/index.css'

import mplayer from './packages/mplayer/index'

import {
	ICON_VERSION
} from './lib/helper/version'

const linkRequest = true;
for (let style of [...document.styleSheets]) {
	if (style.href && style.href === ICON_VERSION) {
		linkRequest = false;
		break;
	}
}
if (linkRequest) {
	const link = document.createElement('link')
	link.rel = 'stylesheet'
	link.href = ICON_VERSION
	link.type = 'text/css'
	document.head.prepend(link)
}

const install = function(Vue) {
	Vue.component(mplayer.name, mplayer)
}

if (typeof window !== 'undefined' && window.Vue) {
	install(window.Vue)
}

export default {
	version: '0.4.8',
	install,
	mplayer
}
